


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<style>
* {
margin: 0;
padding: 0;
text-decoration: none;
list-style-type: none;
}

body {
height: 1200px;
}

.alert-box {
display: table;   /*  居中对齐  */
width: 100%;
height: 100%;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
background: rgba(0, 0, 0, 0.5);
}

.alert {
text-align: center;
display: table-cell;
vertical-align: middle;
}

.alert input {
width: 200px;
height: 30px;
line-height: 30px;
}

b {
font-size: 30px;
color: #FF8400;
cursor: pointer;       /*   鼠标指针放上去 有一个小手      */
}

button {
cursor: pointer;   /*   鼠标指针放上去 有一个小手      */
}

</style>
<title>Document</title>
</head>

<body>
<b>点我出现233333登录模态框</b>
<div class="alert-box">
<div class="alert">
<p><input type="text" placeholder="请输入用户名" value="admin"></p>
<p><input type="password" placeholder="请输入密码"></p>
<button>登录</button>
</div>
</div>


</body>

<script type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">

$('.alert-box').hide();
$('b').on('click', function () {
$('.alert-box').fadeIn();
});
$('button').on('click', function () {
$('.alert-box').fadeOut();
$('b').html('登录成功');
});

</script>
</html>

